package com.huqiwen.table;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class TestDB {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Statement stmt = null;
		ResultSet rs = null;
		String sql = "select * from tabletest";
		try {
			stmt = DataSource.getConnection().createStatement();
			rs = stmt.executeQuery(sql);
			while(rs.next()){
				System.out.println(rs.getString("id"));
				System.out.println(rs.getString("username"));
				System.out.println(rs.getString("password"));
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
